<template>
    <div>
        <h3>我的书籍</h3>
        <mineReturn title="我的书籍" />
        <ul class="show">
            <li v-for="item in books" :key="item.id" @click="clickHandler(item.id)">
                <van-image width="6rem" height="10rem" fit="cover" :src="item.src" />
                <br>
                <span>{{ item.name }}</span>
                <br>
                <span>{{ item.master }}</span>
            </li>
        </ul>
    </div>
</template>

<script>
import { myReadApi } from "../../../api/mineApi"
export default {
    data() {
        return {
            books: ""
        }
    },
    async created() {
        let a = await myReadApi()
        console.log(a)
        this.books = a
    },
    methods:{
        clickHandler(id) {
            this.$router.push(`/bookStore/${id}`)
        }
    }
}
</script>

<style lang="scss" scoped>
.show {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    // flex: 1;
    padding: 0 5px;

    li {
        width: 30%;
    }
}
</style>